package com.kingyun.gpsinspection.purificationservice.facade.service.tdm;


import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.EmployeeVo;
import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.RedisValue;
import com.kingyun.gpsinspection.purificationservice.facade.model.tdm.*;

import java.util.List;

/**
 * 巡回检查业务接口
 * Created by sugongche on 2017/1/15.
 */
public interface PatrolInspectionService {
    /**
     * 保存信息
     *
     * @param employeeVo
     * @param patrolInspection
     * @param uploadFiles
     * @param deletedFiles
     * @param workOrderList
     * @return
     */
    int save(EmployeeVo employeeVo, PatrolInspection patrolInspection, String uploadFiles, String deletedFiles, List<WorkOrderVo> workOrderList);

    /**
     * 更新信息
     *
     * @param patrolInspection
     * @return
     * @throws Exception
     */
    int update(PatrolInspection patrolInspection) throws Exception;

    /**
     * 根据ID查询对象
     *
     * @param patrolInspectionId
     * @return
     * @throws Exception
     */
    PatrolInspection queryBeanById(String patrolInspectionId) throws Exception;

    /**
     * 根据ID查询包装类
     *
     * @param patrolInspectionId
     * @return
     * @throws Exception
     */
    PatrolInspectionVo queryVoById(String patrolInspectionId);

    /**
     * 根据流程实例ID查找对象
     *
     * @param piPiid
     * @return
     */
    PatrolInspectionVo findVoByPiPiid(String piPiid);

    /**
     * 现场操作步骤保存信息
     *
     * @param redisValue
     * @param employeeVo
     * @param patrolInspection
     * @param taskLink
     * @return
     */
    int saveBySpotOperation(RedisValue redisValue, EmployeeVo employeeVo, PatrolInspection patrolInspection, TaskLink taskLink);

    /**
     * 新建分析处理关联的巡回检查任务：不走BPM
     *
     * @param employeeVo
     * @param patrolInspection
     * @param uploadFiles
     * @param deletedFiles
     * @param workOrderList
     * @param analysisProcessId
     * @return
     */
    int saveRelation(EmployeeVo employeeVo, PatrolInspection patrolInspection, String uploadFiles, String deletedFiles, List<WorkOrderVo> workOrderList, String analysisProcessId);

    /**
     * 修改分析处理关联的巡回检查任务页面：不走BPM
     *
     * @param employeeVo
     * @param patrolInspection
     * @param uploadFiles
     * @param deletedFiles
     * @param workOrderVoList
     * @return
     */
    int updateRelation(EmployeeVo employeeVo, PatrolInspection patrolInspection, String uploadFiles, String deletedFiles, List<WorkOrderVo> workOrderVoList);

    /**
     * 发起BPM流程
     *
     * @param redisValue
     * @param employeeVo
     * @param patrolInspection
     * @param workOrderVoList
     */
    int launchBPM(RedisValue redisValue, EmployeeVo employeeVo, PatrolInspection patrolInspection, List<WorkOrderVo> workOrderVoList);
}
